﻿<body>

<script>
			//紀錄目前動態欄位總數
            var rowCounts = 0;
            $(function() {
                $("#btnAdd").click(function() {
                    rowCounts++;

                    //增加一個tr物件，並給予class:dynamic_tr，給它一個id判斷所在位置
                    var tr = $("<tr></tr>").addClass("dynamic_tr").attr("id", "trNo" + rowCounts);
                    //增加一個td物件，文字是它的編號
                    var td = $("<td></td>").text(rowCounts).attr("id", "tdNo" + rowCounts);
                    //將td插入tr中
                    tr.append(td);

                    var td_1 = $("<td></td>");
                    //增加input物件，給予class:ipt，給它一個rowCount判斷所在位置
                    var input = $("<input type=\"text\"/>").addClass("ipt").attr("rowCount", rowCounts).attr("name", "iptNo[" + rowCounts + "]");
//                    var input = $("<input type=\"text\"/>").addClass("ipt").attr("rowCount", rowCounts).attr("id", "iptNo" + rowCounts);
                    td_1.append(input);
                    tr.append(td_1);

                    //將tr插入table
                    $("#myTable").append(tr);
                });
                
            });
		</script>
		<button id="btnAdd">
			{btnAdd}
		</button>
		<hr></hr>
		<div id="displaySec"></div>
		<br>
<?php echo form_open('teacher/create'); ?>		
		<table border="1" id="myTable">
			<tr>
				<th>{lblSkill}</th>
			</tr>
		</table>
		<input type="submit" value="{btnSave}" id="btnSave">	
<?php echo form_close(); ?>
<script src="/career/public/bootstrap/js/bootstrap.min.js"></script>
